package com.example.service.impl;

import com.example.dao.ShoppingCartDao;
import com.example.domain.ShoppingCart;
import com.example.service.ShoppingCartService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ShoppingCartServiceImpl implements ShoppingCartService {
    @Autowired
    private ShoppingCartDao shoppingCartDao;
    @Override
    public List<ShoppingCart> selectall(Long userId) {
        return shoppingCartDao.selectall(userId);
    }

    @Override
    public ShoppingCart selectbyname(String name,Long userId) {
        return shoppingCartDao.selectbyname(name,userId);
    }

    @Override
    public void savethesetmeal(ShoppingCart shoppingCart) {
        shoppingCartDao.savethesetmeal(shoppingCart);
    }

    @Override
    public int getnumberbyname(String name,Long userId) {
        return shoppingCartDao.getnumberbyname(name,userId);
    }

    @Override
    public void savethedish(ShoppingCart shoppingCart) {
        shoppingCartDao.savethedish(shoppingCart);
    }

    @Override
    public void updatenumber(int mumber,Long user,String name) {
        shoppingCartDao.updatenumber(mumber,user,name);
    }

    @Override
    public ShoppingCart sgetnumberbysetmeal(Long id, Long user) {
        return shoppingCartDao.getnumberbysetmeal(id,user);
    }

    @Override
    public void deletebyname(String name, Long userId) {
        shoppingCartDao.deletebyname(name,userId);
    }

    @Override
    public ShoppingCart getnumberbydish(Long dishId, Long userId) {
        return shoppingCartDao.getnumberbydish(dishId, userId);
    }

    @Override
    public void clean(Long userId) {
        shoppingCartDao.clean(userId);
    }
}

